# Maintainer: Filipe Laíns (FFY00) <lains@archlinux.org>
# Contributor: Eli Schwartz <eschwartz@archlinux.org>

pkgname=python-pypubsub
_pkgname=${pkgname#python-}
pkgver=4.0.3
pkgrel=5
pkgdesc="Python publish-subcribe library"
arch=('any')
url="https://github.com/schollii/pypubsub"
license=('BSD')
depends=('python')
makedepends=('python-setuptools')
checkdepends=('python-pytest-runner' 'python-pytest-asyncio')
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
sha512sums=('cf9aca44e91a5d0e5ecf6739deabf2980f9464395c89e3c5335c5248e47c570701e0534bb660c5005325a994d9f8e7f261f36bc8bea74cfc7eb760b73c572652')

build() {
  cd $_pkgname-$pkgver

  python setup.py build
}

check() {
  cd $_pkgname-$pkgver/tests/suite

  PYTHONPATH=$PWD/../../src python -m pytest
}

package() {
  cd $_pkgname-$pkgver

  python setup.py install --root="$pkgdir"  --optimize=1 --skip-build

  install -Dm 644 src/pubsub/LICENSE_BSD_Simple.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
